package com.hejing.反射的应用;

import org.junit.Test;

/**
 * ClassName: NewInstanceTest
 * Package: com.hejing.反射的应用
 * Description:
 *
 * @Author: HeJing
 * @Create: 2023-06-04 18:47
 * @Version: 1.0
 */
public class NewInstanceTest {
    @Test
    public void test01() throws InstantiationException, IllegalAccessException {
        Class clazz = Person.class;

        // 创建Person类的实例
        Person per = (Person) clazz.newInstance();
        System.out.println(per);


    }
}

























